package com.framework.boc.validator;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * 实体验证结果
 */
public class ValidationResult {

    private boolean hasError = false;

    private List<String> errorMessages = new ArrayList<>();

    public boolean isHasError() {
        return hasError;
    }

    public void setHasError(boolean hasError) {
        this.hasError = hasError;
    }

    public void addErrorMessage(String errorMessage) {
        this.errorMessages.add(errorMessage);
    }


    public String getErrorsMessage() {
        return StringUtils.join(errorMessages, ",");
    }

}
